/**
* @describe 易起游房间数据存储
* @author 游金宇(KM)
* @date 2025-04-15 18:48:04
*/


declare global {
    namespace globalThis {
        /**查询房间*/
        var QueryAliveRoom: {
            (): Promise<void>;
        };
        /**离开房间*/
        var LeaveRoom: {
            (): Promise<void>;
        };
        /**创建房间ws*/
        var CreateRoomWebSocket: {
            (): WrapperSocialGameClient;
        };
        /**创建游戏ws */
        var CreateGameWebSocket: {
            (): WrapperSocialGameClient;
        };
    }
}

// 需要引用项目store.user需要继承IUserStore
export interface IUserStore {
    userId: string
}

// 需要引用项目store.game需要继承IGameStore
export interface IGameStore {
    game_token: string
    basePlayers: Player[]
    battle: Battle
}


export interface IRoom {
    room_ws_url: string;
}



import { WrapperSocialGameClient, BaseStore, CoreStore } from "@shimotsuki/core";
import { BattleMode, Room, RoomSchema, SeatStatus, RoomSeatSchema, RoomMode, RoomSeat, Player, Battle } from "sgc";
import { ReportGameStateRequest_GameSettlePayload } from "../pb-generate/server/crazy_watermelon/yiqiyoo/v1/report_battle_pb";


declare class RoomStore extends BaseStore {
    constructor(rootStore: CoreStore);
    /**房间信息 */
    roomInfo: Room;
    /**游戏模式 */
    get mode(): BattleMode;
    /**用户的座位状态 */
    get seatStatus(): SeatStatus;
    /**用户的座位 */
    get userSeat(): RoomSeat | undefined;
    /**房间模式 */
    roomMode: RoomMode;

    /**游戏场景名称 默认 game*/
    gameSceneName: string
}

declare class RankStore extends BaseStore {
    constructor(rootStore: CoreStore);
    rank: ReportGameStateRequest_GameSettlePayload;
}


declare module '@shimotsuki/core' {
    interface CoreStore {
        room: RoomStore;
    }

    interface CoreStore {
        rank: RankStore;
    }

    interface Manager {
        room_ws: WrapperSocialGameClient;
    }

}